/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
*/

package com.jinhe.tss.cms.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;

/** 
 * <p> ChannelDistribute实体对象主键 </p> 
 */
@Embeddable
public class ChannelDistributeId implements Serializable {

	private static final long serialVersionUID = 4201439245098404786L;
	
	private Long distributeFromId;   // 分发栏目，源栏目ID 
	private Long distributeToId;	   // 分发栏目，目标栏目ID 
    
    public Long getDistributeFromId() {
        return distributeFromId;
    }
 
    public Long getDistributeToId() {
        return distributeToId;
    }
 
    public void setDistributeFromId(Long distributeFromId) {
        this.distributeFromId = distributeFromId;
    }
 
    public void setDistributeToId(Long distributeToId) {
        this.distributeToId = distributeToId;
    }
 
    public boolean equals(Object obj) {
        if(obj == null) return false;
        
        if(!(obj instanceof ChannelDistributeId)) return false;
        
        ChannelDistributeId object = (ChannelDistributeId)obj;
        return distributeToId.equals(object.getDistributeToId()) && distributeFromId.equals(object.getDistributeFromId());     
    }   
 
    public int hashCode() {
        return (this.distributeToId + "_" + this.distributeFromId).hashCode();
    } 
 
    public String toString() {
        StringBuffer sb = new StringBuffer();
		sb.append("id = ").append(this.distributeToId).append(", distributeId = ").append(this.distributeFromId);
		return sb.toString();
    }
}

